﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Task.Common.Interface;
using Common.Service;
using System.Collections;
using Task.Common.Entity;

using UltLibrary;
using Common.BasePages;

namespace Task.InternalSponsor
{
    public partial class Start :ProcessBasePage
    {
        ITask task = ServiceContainer.GetService<ITask>();
        protected void Page_Load(object sender, EventArgs e)
        {
            txtRequestDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            //UltLibrary.UltApi.UltHelper.ActiveTaskByProcessName
        }
        public string Index { get; set; }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (UltLibrary.UltApi.UltHelper.ActiveTaskByProcessName("内部协办流程", "ULTIMUS/Administrator"))
            {
                int incident = int.Parse(String.IsNullOrEmpty(base.Incident) ? "0" : base.Incident);
                string Error = "";//如果流程发起失败返回的错误信息
                UltLibrary.EnumHelper.EnumType.TaskStatus ResultStatus;
                if (incident > 0)
                {
                }
                else
                {
                    ResultStatus = UltApi.UltHelper.SendTask(null, "内部协办流程；FLWC-2012-2012", ref incident, ref Error);//发起时调用
                }
                Page.RegisterClientScriptBlock("close", "<script>alert('流程提交成功!');setTimeout('window.location=\"../../Portal/Main.aspx\"',1000);</script>");
            }
        }

    }
}